package demo;

import dao.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 1.导入坐标
 * 2.创建Bean
 * 3.创建ApplicationContext.xml
 * 4.在配置文件中进行配置
 * 5.创建ApplicationContext.xml对象getBean
 */
public class UserDaoDemo {
    public static void main(String[] args) {
        ApplicationContext app =new ClassPathXmlApplicationContext("applicationContext.xml");
        UserDao u =(UserDao)app.getBean("userDao");
        u.save();
    }
}
